<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
         <?php $_SESSION['page_name']='Set Up';include('Menu.php');?>
           <script type="text/javascript" src="jsSetUp.js"></script>
        <script type="text/javascript">
function AddAnswers(){
     var answer = new Array();
    //var ans = new Array();
                var x=1;
            var ans = document.forms["form1"]["Select1"].value;
             if (ans == "Multiple Choice") {
                for(x;x<=4;x++){
                    answer[x]=prompt ("Please Add your answer"+ x +"","Answer"); 
                       var TheTextBox = document.getElementById(x);
    TheTextBox.value = TheTextBox.value + answer[x]; 
                }
   
                }
            
         //Anna   else    if (ans == "Text to Fill") { x=1;answer[x]=prompt ("Please Add your answer"+ x +"","Answer");var TheTextBox = document.getElementById(x);
  //Anna   TheTextBox.value = TheTextBox.value + answer[x]; }
   // Save data to a the current session's store  
       //sessionStorage.setItem("answer", answer);
            }
            function getsession(){
                
                // Access some stored data  
document.getElementById['fooBar'].innerHTML=sessionStorage.getItem("answer"); 
//sendQA(sessionStorage.getItem("answer"));
            }
        </script>
    </head>
    <body><form name="form1" action="Question.php" method="post">
     <table bgcolor="#C8C8C8" border="1">
        <thead><tr><td>Experiment ID</td><td><input name="id_Exp"  disabled="disabled" value="<?php echo $_SESSION['id_Exp']; ?>" />&nbsp;&nbsp;ID Task <input id="task_id" disabled="disabled" value="<?php echo $_SESSION['id_task']; ?>" /></td></tr></thead>
            
      <tr><td>Question</td><td><textarea cols="65"  id="Text4" name="questionName" type="text"></textarea></td></tr>
 <tr><td>Answer Type</td><td><select id="Select1" name="D1" onchange="AddAnswers()" >
            <option value="PLZ Choose your answer Type">PLZ Choose your answer Type</option>
            <option value="Multiple Choice">Multiple Choice</option>
            <option value="TrueFalse">TrueFalse</option>
            <option value="Text to Fill">Text</option>
        </select></td></tr>
       
 
 <tr><td>Comment</td><td> <textarea cols="65" type="text" name="comment"> </textarea></td></tr><tr></tr>
        
   <tr><td></td>
        <td  style= "text-align: right;"><input type="submit" name="tasks" value="Save Question and Add another" 
            style="height: 42px" onclick="getsession()"/> 
       <input type="submit" name="tasks" value="Finish and Show Saved entries" style="height: 40px; width:auto;"/></td>
    
        </tr>
        </table>
          <input id="1" name= "1" type="text"/> <input id="2" type="text" name="2"/>   <input id="3" type="text" name="3"/>   <input id="4" name="4" type="text"/>   

        </form>
    </body>
</html>
